var webpack = require('webpack')
module.exports = {
  devServer: {
    proxy: {
      '/api': {
        target: 'http://localhost:3000/',  // 接口域名
        changeOrigin: true,  //是否跨域
        ws: true,
        pathRewrite: {
          '^/api': '/api'   //需要rewrite重写的,
        }
      }
    }
  },
  configureWebpack: {
    module: {
      rules: [
        {
          test: /\.md$/,
          loader: 'vue-markdown-loader',
          loader: 'text-loader',
          options: {
            preprocess: function (MarkdownIt, Source) {
              MarkdownIt.renderer.rules.table_open = function () {
                return '<div class="table-container"><table class="table">';
              };
              MarkdownIt.renderer.rules.table_close = function () {
                return '</table></div>';
              };
              return Source;
            }
          }
        }
      ]
    }
  }
  // configureWebpack: {
  //   plugins: [
  //     new webpack.ProvidePlugin({
  //       $: "jquery",
  //       jQuery: "jquery",
  //       'window.jQuery': 'jquery',
  //       Popper: ['popper.js', 'default']
  //     })
  //   ]
  // }
}
